<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <!--    for fit mobil devices-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">

    <title th:text="${title}">Title</title>

    <!-- semantic UI CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">

    <link rel="stylesheet" href="../static/lib/typocss/typo.css" th:href="@{/lib/typocss/typo.css}">
    <link rel="stylesheet" href="../static/lib/animatecss/animate.css" th:href="@{/lib/animatecss/animate.css}">
    <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/lib/prism/prism.css}">
    <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/lib/tocbot/tocbot.css}">
    <link rel="stylesheet" href="../static/css/my.css" th:href="@{/css/my.css}">
    <link rel="stylesheet" href="../static/lib/editormd/css/editormd.min.css" th:href="@{/lib/editormd/css/editormd.min.css}">

</head>
<body>

    <!--navigator-->
    <nav th:fragment="navigator(cur_active)" class="ui inverted attached segment my-shadow">
        <div class="ui container">
            <div class="ui inverted secondary stackable menu my-padded-tb-xs">
                <h2 class="ui teal header item">myBlog</h2>
                <a href="#" th:href="@{/}" class="my-menu-item item my-mobile-hide" th:classappend="${cur_active == 'home'} ? 'active'"><i class="home icon"></i>Home</a>
                <a href="#" th:href="@{/categories/-1}" class="my-menu-item item my-mobile-hide" th:classappend="${cur_active == 'categories'} ? 'active'"><i class="idea icon"></i>Categories</a>
                <a href="#" th:href="@{/tags/-1}" class="my-menu-item item my-mobile-hide" th:classappend="${cur_active == 'tags'} ? 'active'"><i class="tags icon"></i>Tags</a>
                <a href="#" th:href="@{/history}" class="my-menu-item item my-mobile-hide" th:classappend="${cur_active == 'history'} ? 'active'"><i class="folder open icon"></i>History</a>
                <a href="#" th:href="@{/about}" class="my-menu-item item my-mobile-hide" th:classappend="${cur_active == 'about'} ? 'active'"><i class="info icon"></i>About me</a>
                <div class="my-menu-item right item my-mobile-hide">
                    <form name="search" action="" method="post" th:action="@{/search}" target="_blank">
                        <div class="ui icon transparent inverted input">
                            <input type="hidden" name="page">
                            <label for="search"></label>
                            <input type="text" name="query" placeholder="Search..." th:value="${query}" id="search">
                            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <a href="#" class="ui black icon button my-top-right my-mobile-show" id="menu_toggle">
            <i class="sidebar icon"></i>
        </a>
    </nav>

    <!--footer-->
    <footer th:fragment="footer" class="ui inverted vertical segment my-padded-tb-ml">
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid">
                <div class="three wide column">
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../static/images/QR_Wechat.jpg" th:src="@{/images/QR_Wechat.jpg}" class="ui rounded image" style="width: 110px" alt="">
                        </div>
                    </div>
                </div>

                <div class="three wide column">
                    <h4 class="ui inverted header my-text-spaced my-opacity-mini">NEW BLOGS</h4>
                    <div id="newBlog-container">
                        <div th:fragment="newBlogList" class="ui inverted link list">
                            <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" class="item" target="_blank" th:each="blog : ${newBlogs}" th:text="${blog.title}">User Story</a>
                        </div>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header my-text-spaced my-opacity-mini">CONTACT ME</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item" th:text="#{footer.email}">Email: qdwangzy@outlook.com</a>
                        <a href="#" class="item">QQ: 1278669362</a>
                        <!--                        <a href="#" class="item"></a>-->
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header my-text-spaced my-opacity-mini">myBlog</h4>
                    <p class="my-text-extreme-thin my-text-spaced my-opacity-mini">This my personal blog. Designing, thinking and coding.</p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="my-text-extreme-thin my-text-spaced my-opacity-tiny">All content copyright Ziyue Wang © 2020 • All rights reserved.</p>
        </div>
    </footer>

    <div th:fragment="scripts">
        <div th:replace="_fragments :: basic_scripts"></div>
        <script src="https://cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
        <script src="../static/lib/prism/prism.js" th:src="@{/lib/prism/prism.js}"></script>
        <script src="../static/lib/tocbot/tocbot.min.js" th:src="@{/lib/tocbot/tocbot.min.js}"></script>
        <script src="../static/lib/QRcode/qrcode.min.js" th:src="@{/lib/QRcode/qrcode.min.js}"></script>
        <script src="../static/lib/waypoints/jquery.waypoints.js" th:src="@{/lib/waypoints/jquery.waypoints.js}"></script>
    </div>

    <div th:fragment="basic_scripts">
        <script
                src="https://code.jquery.com/jquery-3.1.1.min.js"
                integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
                crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
        <script>
            $('#newBlog-container').load(/*[[@{/footer/newBlogs}]]*/"/footer/newBlogs");
        </script>
    </div>
</body>
</html>